package com.iris.live.services.report.data.timeline;

import com.iris.live.services.report.data.ColumnUnit;
import com.iris.live.services.report.data.ReportContext;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @author: Tony.Zhang
 * @Date: 2017-08-12 14:52
 **/
public class TimelineContext extends ReportContext {
    private List<TimeUnit>  timeUnits = new ArrayList<>();
    private String          timeColumn = null; //数据库结果集中时间字段,系统根据该字段从原始数据获取时间信息，然后再在TimeUnit进行处理

    public String getTimeColumn() {
        return timeColumn;
    }

    public void setTimeColumn(String timeColumn) {
        this.timeColumn = timeColumn;
    }

    public List<TimeUnit> getTimeUnits() {
        return timeUnits;
    }

    public void addTimeUnit(TimeUnit timeUnit) {
        timeUnits.add(timeUnit);
    }

    public void addTimeUnit(List<TimeUnit> timeUnits) {
        this.timeUnits.addAll(timeUnits);
    }

    @Override
    public List<? extends ColumnUnit> getColumnUnits() {
        return timeUnits;
    }
}
